package com.baidu.mpks.user.domain;

import com.baidu.mpks.util.Phone;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Email;
import java.util.Date;

@Data
public class UserSync {

    public static final String STATUS_INVALID = "Close";
    public static final String STATUS_VALID = "Open";
    private Integer id;
    @NotBlank(
            message = "userId不能为空"
    )
    private String userId;
    @NotBlank(
            message = "roleIds角色信息不能为空"
    )
    private String roleIds;
    @NotBlank(
            message = "用户名不能为空"
    )
    @Length(
            max = 25
    )
    private String userName;
    @NotBlank(
            message = "昵称不能为空"
    )
    @Length(
            max = 25
    )
    private String trueName;
    @NotBlank(
            message = "性别不能为空"
    )
    private String gender;
    @Email(
            message = "邮件格式错误"
    )
    private String email;
    @Phone(
            message = "手机格式错误"
    )
    private String phoneNumber;
    private String avatar = "";
    private String opType;
    private String code;
    private Integer isActive;
    private String status = "Open";
    private String createBy;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date createTime;
    private String userInfo;
}
